package wangn.adt.base;

/**
 * 因为经常用到二元组，但是Java没有支持，所以直接在这里定义一个二元组的ADT
 */
public class Pair<T,E> {
    private T first;
    private E second;
    public Pair(){}

    public Pair(T first, E second) {
        this.first = first;
        this.second = second;
    }

    public T getFirst() {
        return first;
    }

    public void setFirst(T first) {
        this.first = first;
    }

    public E getSecond() {
        return second;
    }

    public void setSecond(E second) {
        this.second = second;
    }

    @Override
    public String toString(){
        return getFirst()+","+getSecond();
    }
}
